<div id="content">

    <section class="inner">

        <div class="box more clearfix">

            <div class="title clearfix">
                <!--<div class="stars small yelow star-5"></div>-->
                <div class="stars yelow large star-<?= $details->object_number_of_stars ?>">&nbsp;</div>


                <?if($details->avg_reviews_score>0):?>
                <div class="right rating">
                    <span id="score"><?= $details->avg_reviews_score ?> <?= lang($details->avg_reviews_score); ?></span> 
                </div>
                <?endif?>
                <h1>
                    <?= $details->object_name ?> - <?= lang('room.' . underscore($details->cur_room->room_type_name)); ?>
                    <? if ($details->cur_room->room_description != "") echo $details->cur_room->room_description; ?>
                </h1>
                <? if (isset($details->object_recommended) && $details->object_recommended == '1'): ?>
                <div class="recomended"><?= lang('recommended') ?></div>
                <? endif; ?>
            </div>


            <div class="gallery clearfix">

                <div id="gallery" class="content">
                    <div class="slideshow-container">
                        <div id="loading" class="loader"></div>
                        <div id="slideshow" class="slideshow"></div>
                    </div>
                </div>
                <div id="thumbs" class="clearfix">
                    <ul class="thumbs ">
                        <span class="fake"></span>
                        <?
                        //$this->firephp->log($details);
                        $P = HOST_URL_HOTELS . 'gallery/' . $details->photo_path;
                        $cnt = count($details->photos);
                        for ($i = 0; $i < $cnt; $i++):?>
                        <li>
                            <a class="thumb" name="bigleaf" href="<?= $P . '/thumb_606x341/' . $details->photos[$i]->photo_name; ?>"  title="Title #<?= $i ?>">
                                <img src="<?= $P . '/thumb_72x72/' . $details->photos[$i]->photo_name; ?>"  title="Title #<?= $i ?>">
                            </a>
                        </li>
                        <?endfor;?>


                    </ul>
                </div>

            </div><!-- Photo Gallery -->

            <?

            //$this->firephp->log($details->availability);
            /*
            * Checkin, Checkout
            */
            $check_in = date('d.m.Y', strtotime("+1 day"));

            if (isset($_GET['check_in']))
            $check_in = $_GET['check_in'];

            $check_out = date('d.m.Y', strtotime("+2 day"));

            if (isset($_GET['check_out']))
            $check_out = $_GET['check_out'];

            /*
            * Number persons
            */
            $sel_text = 'selected = "selected"';

            if (isset($_GET['nr_adults'])) {
            $selected = $_GET['nr_adults'];
            $cnt = (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') ? 5 : 12;
            } else if (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') {
            $selected = 2;
            $cnt = 5;
            } else {
            $selected = 2;
            $cnt = 5;
            }

            /*
            * Service and prices
            */
            $service_name = $details->cur_room->service_name;
            $service_total = !isset($_GET['preview']) ? $details->cur_room->selling_total : '0';

            ?>

            <div class="cont">
                <div class="sociallinks">

                    <ul class="addthis_toolbox addthis_default_style">
                        <li><a class="addthis_button_tweet"></a></li>
                        <li><a class="addthis_button_google_plusone" g:plusone:size="medium"></a></li>
                        <li><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a></li>
                        <li><a class="addthis_counter addthis_pill_style"></a></li>

                    </ul>
                </div>
            </div>

            <div class="cont  calculation" style="padding-right: 12px; padding-left: 14px">

                <div class="clearfix">

                    <div class="pp">

                        <div class="col">

                            <div class="dec">
                                <div class="loc"><?= $details->destination_name ?>, <?= lang('montenegro'); ?></div>

                                <? if (isset($details->object_x_coordinate) && $details->object_x_coordinate != "" && isset($details->object_y_coordinate) && $details->object_y_coordinate != ""): ?>
                                <a href='javascript:' class="show_map_inline"><?= lang('map.show_on_map') ?></a>
                                <? endif; ?>
                            </div>

                        </div>

                        <div class="col">
                            <span><?= lang('dtl.room'); ?>: </span>
                            <?= lang('room.' . underscore($details->cur_room->room_type_name)); ?>  <span class="gray"><?= $details->cur_room->service_name ?></span>
                            <? if($details->cur_room->room_description != "") echo $details->cur_room->room_description; ?>

                        </div>
                        <div class="col">
                            <span><?= lang('dtl.period'); ?>:</span>
                            <?= $check_in ?> - <?= $check_out ?>

                        </div>
                        <div class="col">
                            <span><?= lang('dtl.num_of_persons'); ?>:</span>
                            <span class="service_persons">
                                <?= lang('dtl.adults'); ?>: <?= !isset($_GET['preview']) ? $_GET['nr_adults'] : $selected ?>,
                                <?= lang('dtl.children'); ?>: 0,
                                <?= lang('dtl.babies'); ?>: 0
                            </span>
                        </div>

                    </div>

                    <div class="pp ">
                        <? foreach ($details->polices as $key => $value):?>
                        <div class="col ellipsis">
                            <span><?= lang('dtl.' . underscore($key)); ?>:</span> <?= $value == "" ? '&nbsp;' : $value; ?> 
                        </div>
                        <? endforeach; ?>
                        <div class="col">
                            <span><?= $service_name ?>:</span> <span class="service_total"><?= $service_total ?> </span> €
                        </div>
                        <div class="col total">
                            <span><?= lang('total'); ?>:</span> 
                            <span class="service_total"><?= $service_total ?> </span> <span class="euro">€</span>
                        </div>

                        <div class="too_many"></div>

                        <div class="col block">
                            <button class="button green centered"><?= lang('res.book_now') ?></button>
                        </div>

                    </div>

                </div>


            </div>

        </div>

    </section>

    <section class="inner">


        <div id="tabvanilla" class="widget clearfix">

            <ul class="tabnav clearfix">
                <li><a href="#information_tab"><?= lang('dtl.information'); ?></a></li>
                <li><a href="#prices_tab"><?= lang('dtl.prices_availability') ?></a></li>
                <li><a href="#map_tab" id="do_google_map"><?= lang('c.location') ?></a></li>
                <? if ($details->avg_reviews_score > 0): ?>
                <li id="do_reviews"><a href="#reviews"><?= lang('dtl.reviews') ?></a></li>
                <? endif; ?>
            </ul>

            <div class="span10 details_content box more">

                <div id="information_tab" class="tabdiv">

                    <div class="section clearfix facilities">

                        <? if ((isset($details->object_info) && ($details->object_info != "")) || ((isset($details->cur_room->room_info) && ($details->cur_room->room_info != "")))): ?>
                        <h3><?= $details->object_name ?></h3>
                        <div class="info">
                            <?= $details->cur_room->room_info ?>
                            <?= $details->object_info ?>
                        </div>
                        <br>
                        <? endif; ?>

                        <div class="read_me_more" id="facilities">
                            <div class="read_me_gradient"></div>

                            <? $this->load->view('parts/facilities') ?>
                        </div>
                    </div>

                    <div class="section clearfix facilities">

                        <div class="read_me_more" id="polices">
                            <div class="read_me_gradient"></div>

                            <div class="row">
                                <div class="span2"><?= lang('dtl.cancellation_policy'); ?>:</div>
                                <div
                                    class="span7"><?= $details->object_cancellation == "" ? '&nbsp;' : $details->object_cancellation; ?></div>
                            </div>
                            <div class="row">
                                <div class="span2"><?= lang('dtl.children_and_extra_beds'); ?>:</div>
                                <div
                                    class="span7"><?= $details->object_extra_bed == "" ? '&nbsp;' : $details->object_extra_bed; ?></div>
                            </div>

                        </div>

                    </div>

                    <? if (count($details->rooms) > 1): ?>

                    <div class="section clearfix">

                        <? $this->load->view('parts/otherAccommodationUnits') ?>

                    </div>

                    <? endif; ?>

                </div>

                <div id="prices_tab" class="tabdiv">
                    <? $this->load->view('parts/prices') ?>
                </div>

                <div id="map_tab" class="tabdiv">
                    <div id="google_map"></div>

                    <div style="clear: both"></div>

                    <div class="section clearfix facilities" style="margin-top: 25px">

                        <h3><?= lang('dtl.distances_from'); ?></h3>

                        <div>
                            <?= $distances_from ?>
                        </div>

                    </div>

                </div>

                <? if ($details->avg_reviews_score > 0): ?>
                <div id="reviews" class="tabdiv">

                    <div id="hotels-placeholder">
                        <div id="hotel-reviews">

                            <? $this->load->view('parts/reviews') ?>

                        </div>
                    </div>

                </div>
                <? endif; ?>

            </div>

        </div>

    </section>

</div>